using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Activation;
using Pixysoft.Framework.Logs.Core;

namespace Pixysoft.Framework.Logs
{
    [AttributeUsage(AttributeTargets.Class)]
    public class LoggerAttribute : ContextAttribute
    {
        string id = null;

        string module = null;

        public LoggerAttribute() : base("Logger") { }

        public LoggerAttribute(string id)
            : base("Logger")
        {
            this.id = id;
        }

        public LoggerAttribute(string id, string module)
            : base("Logger")
        {
            this.id = id;

            this.module = module;
        }

        public override void GetPropertiesForNewContext(IConstructionCallMessage ccm)
        {
            ccm.ContextProperties.Add(new LoggerProperty(id, module));
        }

        public string Id
        {
            get { return id; }
        }

        public string Module
        {
            get { return module; }
        }

    }
}
